#include<stdio.h>
int a[2][4]={
	0,0,1,-1,
	-1,1,0,0
	};
int b[7][7],sum=0;
void dfs(int x,int y)
{
	if(x<=0||y<=0||x>=6||y>=6){
		sum++;
		return;
	}
	for(int i=0;i<4;i++){
		int n_x=x+a[0][i];
		int n_y=y+a[1][i];
		if(!b[n_x][n_y]&&!b[6-n_x][6-n_y]){
			b[n_x][n_y]=1;
			b[6-n_x][6-n_y]=1;
			dfs(n_x,n_y);
			b[n_x][n_y]=0;
			b[6-n_x][6-n_y]=0;
		}
	}
}
int main()
{
	b[3][3]=1;
	dfs(3,3);
	printf("%d",sum/4); 
	return 0;
}

